#!/usr/bin/env python
#-*- coding:utf-8 -*-

import gtk


class VisualBit(gtk.Viewport):
    
    def __init__(self):
        gtk.Viewport.__init__(self)
        self.set_shadow_type( gtk.SHADOW_IN )
        self.modify_bg( gtk.STATE_NORMAL, gtk.gdk.color_parse( "white" ) )

        self.lab = gtk.Label()
        self.lab.show()
        self.lab.set_padding( 10, 0 )
        
        self.add( self.lab )
        self.show()
        
        self.set_bit(1)
    
    def set_bit(self, bit):
        txt = ("<big><big><big><span font='Tahoma 18'>" + \
            "%d</span></big></big></big>") % bit
        self.lab.set_markup( txt )
    
    def set_default_color(self):
        self.modify_bg( gtk.STATE_NORMAL, gtk.gdk.color_parse( "white" ) )
    
    def set_special_color(self):
        self.modify_bg( gtk.STATE_NORMAL, gtk.gdk.color_parse( "#ddeeff" ) )

